﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SmartWMS.Common.ResponseOutput;
using SmartWMS.Domain.BasicsDatum;
using SmartWMS.Server.StatementServer.ForewarningServices;
using SmartWMS.Server.StatementServer.ForewarningServices.Dto;

namespace SmartWMS.API.Controllers.StatementMange
{
    /// <summary>
    /// 库存预警
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = "Statement")]

    public class ForewarningController : ControllerBase
    {
        private readonly IForewarningService _forewarningService;

        public ForewarningController(IForewarningService forewarningService)
        {
            _forewarningService = forewarningService;
        }
        /// <summary>
        /// 库存预警列表(分页)
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost]
        public  Task<Response<List<ForewarningDto>>> GetForewarningDto(ForewarningSelect dto)
        {
           var result= _forewarningService.GetForewarningDto(dto);
            return result;
        }

        /// <summary>
        /// 仓库列表
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<List<Warehouse>>> GetWarehouseList()
        {
            var result= _forewarningService.GetWarehouseList();
            return result;
        }
    }
}
